<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
  <meta name="generator" content="Hugo 0.88.1">
  <title>Signin Template · Bootstrap v5.1</title>

  <link rel="canonical" th:href="@{https://getbootstrap.com/docs/5.1/examples/sign-in/}">



  <!-- Bootstrap core CSS -->
  <link th:href="@{/assets/dist/css/bootstrap.min.css}" rel="stylesheet">

  <style>
    .bd-placeholder-img {
      font-size: 1.125rem;
      text-anchor: middle;
      -webkit-user-select: none;
      -moz-user-select: none;
      user-select: none;
    }

    @media (min-width: 768px) {
      .bd-placeholder-img-lg {
        font-size: 3.5rem;
      }
    }

    .box{
      width: 300px;
      height: 300px;
      /*background: #0dcaf0;*/
      border-radius: 10px;
      background-image: linear-gradient(to bottom right,#ECEFF1,#CFD8DC,#B0BEC5,#90A4AE,#78909C,#607D8B);

      box-shadow: 0px 0px 5px #888888;
    }

    .form-floating{
      margin: 5px 0 5px 0;
    }
    .form-control{
      border-radius: 0.4rem;
    }
    .form-floating>.form-control{
      height: 50px;
    }
    .btn{
      margin:10px 5px 10px 5px;
    }

    .btn:hover{
      background: #fff2df;
      transition: 0.5s;
    }
  </style>


  <!-- Custom styles for this template -->
  <link th:href="@{/css/signin.css}" rel="stylesheet">

</head>
<body>

<main class="form-signin box">
<!--  <img class="mb-4" th:src="@{/assets/brand/bootstrap-logo.svg}" alt="" width="72" height="57">-->
  <h1 class="h3 mb-3 fw-normal text-center">请登录</h1>
  <form th:action="@{/login}" method="post">
    <div class="form-floating">
      <input type="text" class="form-control" id="floatingInput" placeholder="username"  name="username">
      <label for="floatingInput">用户名</label>
    </div>
    <div class="form-floating">
      <input type="password" class="form-control" id="floatingPassword" placeholder="Password" name="password">
      <label for="floatingPassword">密码</label>
    </div>
    <div class="text-center">
      <button class="btn btn-lg " type="submit">登录</button>
      <a th:href="@{/register}"><button class=" btn btn-lg " type="button">注册</button></a>
    </div>
    <p th:if="${param.error}" class="text-center">用户名或密码错误，登录失败！</p>
  </form>
</main>

<script>
  window.onload=function(){
    var w = document.documentElement.scrollWidth;
    var h = document.documentElement.scrollHeight;
    w = (w-300)/2;
    h = (h-300)/2;
    var box = document.querySelector(".box");
    box.style.position = 'absolute';
    box.style.left = w+'px';
    box.style.top = h+'px';
  }
</script>

</body>
</html>
